package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.OfficialWebsiteArticle;
import com.sc.nft.mapper.OfficialWebsiteArticleMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

/**
 * 官网文章(OfficialWebsiteArticle)表Dao层
 *
 * @author wwc
 * @since 2023-08-09 17:37:06
 */
@Slf4j
@Repository
public class OfficialWebsiteArticleDao extends ServiceImpl<OfficialWebsiteArticleMapper, OfficialWebsiteArticle> {

    public IPage<OfficialWebsiteArticle> pageWeb(Page toMp) {
        LambdaQueryWrapper<OfficialWebsiteArticle> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.orderByDesc(OfficialWebsiteArticle::getSort);
        return page(toMp, lambdaQueryWrapper);
    }
}
